/**
 * @UiButton.hpp
 * Copyright 2013 (C) FatalEror / Dean Bahari
 * 
 * UiPack is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * See LICENSE file in main folder for more information.
 */

#ifndef _UI_BUTTON_HPP_
#define _UI_BUTTON_HPP_

#include "UiControl.hpp"
#include "UiEvent.hpp"

class UiButton : public UiControl {
	std::wstring    mText;
	int             mType;
	Gdiplus::Image *mImage;
	void           *mCallback;
	void           *mParam;
public:
	UiButton(const wchar_t *text);
	UiButton(UiBase *parent, const wchar_t *text, unsigned int width, unsigned int height, int x, int y);
	~UiButton();

	Gdiplus::Image *getImage();
	const wchar_t  *getText();

	void setCallback(void *callback, void *param = NULL);
	void setImage(const wchar_t *imageDir);
protected:
	virtual void onClick(UiEvent &ev);
	virtual void onEnter(UiEvent &ev);
	virtual void onLeave(UiEvent &ev);
	virtual void onPaint(UiEvent &ev);
};

#endif//_UI_BUTTON_HPP_